using System;
using System.Windows.Forms;
using Tsanie.ShellExtension.Util;

namespace Tsanie.ShellExtension.PropertySheet.UI {
    public class ButtonEx : Button {
        private Action _action;

        public Action Action { set { _action = value; } }

        public ButtonEx()
            : base() {
            _action = null;
        }

        protected override void OnClick(EventArgs e) {
            base.OnClick(e);
            _action.SafeRun();
        }
    }
}